using SeataNet.Core.Common;

namespace SeataNet.Core.Model
{
    /// <summary>
    /// 分支事务状态查询响应
    /// </summary>
    public class BranchStatusResponse
    {
        /// <summary>
        /// 分支事务状态
        /// </summary>
        public BranchStatus Status { get; set; }

        /// <summary>
        /// 结果代码
        /// </summary>
        public ResultCode ResultCode { get; set; }

        /// <summary>
        /// 消息
        /// </summary>
        public string Message { get; set; } = string.Empty;

        /// <summary>
        /// 错误代码
        /// </summary>
        public string? ErrorCode { get; set; }

        /// <summary>
        /// 错误消息
        /// </summary>
        public string? ErrorMessage { get; set; }

        /// <summary>
        /// 是否成功
        /// </summary>
        public bool Success => ResultCode == ResultCode.Success;
    }
}
